package com.example;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyClass {
    public static void main(String[] args){
        Schema schema = new Schema(1,"com.liuzhongni.wahahanews.dao");
        Entity entity = schema.addEntity("Person");
        //数据库字段名
        entity.addLongProperty("_id").primaryKey().autoincrement();
        entity.addStringProperty("name");
        entity.addIntProperty("age");
        //第二张表
        Entity dog = schema.addEntity("Dog");
        dog.addLongProperty("_id").primaryKey().autoincrement();
        dog.addStringProperty("name");

        try {
            new DaoGenerator().generateAll(schema,"./app/src/main/java");
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
